import subprocess
import time

p = subprocess.Popen('python wc.py',stdin=subprocess.PIPE,stdout=subprocess.PIPE)
s = globals()

p.stdin.write(b'aaaaaaaaaaaa\n')
p.stdin.write(b'aaaaaaaaaaaa\n')
p.stdin.write(b'aaaaaaaaaaaa\n')
p.stdin.write(b'aaaaaaaaaaaa\n')

stdout,stderr = p.communicate()
print(stdout.decode())
time.sleep(3)
